package com.itheima;

import com.itheima.service.AccountService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author cp
 * @className App
 * @description TODO
 * @create 2020/12/5 19:23
 **/

/*
    @Scope注解
        类型：类注解
        位置：类定义上方
        注解:
            @Scope("singleton") 单例
            @Scope("prototype") 多例
 */
public class App {
    public static void main(String[] args) {
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("applicationContext.xml");
        AccountService service1 = (AccountService) applicationContext.getBean("accountService");
        AccountService service2 = (AccountService) applicationContext.getBean("accountService");
        service1.save();
        service2.save();
    }
}
